﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ExchangeListener
{
    class Program
    {
        static void Main(string[] args)
        {
          

            Start();
            Console.WriteLine("That's all");
            Console.ReadLine();
        }

        static void Start()
        {

            DateTime StartDate = DateTime.Now;
            DateTime EndDate = DateTime.Now.AddDays(1);

            using (ExchangeServiceBinding esb=new ExchangeServiceBinding())
            {
                esb.Url = Info.SeverUrl;

                // 域环境下使用
                //esb.UseDefaultCredentials = true;

                esb.Credentials = new System.Net.NetworkCredential(Info.UserName, Info.Password, Info.Domain);

                try
                {
                   // CalendarNotifier cl = new CalendarNotifier(esb);
                   // cl.DoWork(StartDate, EndDate);
                    ContactSync cs = new ContactSync(esb);
                    cs.DoWork();
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.ToString());
                }
            }
        }
    }
}
